package cn.laiguowei.May3.MD5Signature.bean;

import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@MappedSuperclass
@Data
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * @Description:创建时间
     */
    @CreatedDate
    @Column(nullable = false, updatable = false)
    public Date createTime;

    /**
     * @Description: 修改时间
     */
    @LastModifiedDate
    @Column(nullable = false)
    private Date modifyTime;

    /**
     * @Description: 创建人
     */
    @CreatedBy
    private Integer createBy;

    /**
     * @Description: 最后修改人
     */
    @LastModifiedBy
    private Integer lastModifiedBy;

}
